home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-PPC / SERIAL.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  5KB  |  124 lines

  1. /*
  2.  * include/asm-ppc/serial.h
  3.  */
  4.  
  5. #include <linux/config.h>
  6.  
  7. #ifdef CONFIG_APUS
  8. #include <asm-m68k/serial.h>
  9. #else
  10.  
  11. /*
  12.  * This assumes you have a 1.8432 MHz clock for your UART.
  13.  *
  14.  * It'd be nice if someone built a serial card with a 24.576 MHz
  15.  * clock, since the 16550A is capable of handling a top speed of 1.5
  16.  * megabits/second; but this requires the faster clock.
  17.  */
  18. #define BASE_BAUD ( 1843200 / 16 )
  19.  
  20. /* Standard COM flags (except for COM4, because of the 8514 problem) */
  21. #ifdef CONFIG_SERIAL_DETECT_IRQ
  22. #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ)
  23. #define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ)
  24. #else
  25. #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
  26. #define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
  27. #endif
  28.  
  29. #ifdef CONFIG_SERIAL_MANY_PORTS
  30. #define FOURPORT_FLAGS ASYNC_FOURPORT
  31. #define ACCENT_FLAGS 0
  32. #define BOCA_FLAGS 0
  33. #define HUB6_FLAGS 0
  34. #endif
  35.     
  36. /*
  37.  * The following define the access methods for the HUB6 card. All
  38.  * access is through two ports for all 24 possible chips. The card is
  39.  * selected through the high 2 bits, the port on that card with the
  40.  * "middle" 3 bits, and the register on that port with the bottom
  41.  * 3 bits.
  42.  *
  43.  * While the access port and interrupt is configurable, the default
  44.  * port locations are 0x302 for the port control register, and 0x303
  45.  * for the data read/write register. Normally, the interrupt is at irq3
  46.  * but can be anything from 3 to 7 inclusive. Note that using 3 will
  47.  * require disabling com2.
  48.  */
  49.  
  50. #define C_P(card,port) (((card)<<6|(port)<<3) + 1)
  51.  
  52. #define STD_SERIAL_PORT_DEFNS            \
  53.     /* UART CLK   PORT IRQ     FLAGS        */            \
  54.     { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS },    /* ttyS0 */    \
  55.     { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS },    /* ttyS1 */    \
  56.     { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS },    /* ttyS2 */    \
  57.     { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS },    /* ttyS3 */
  58.  
  59.  
  60. #ifdef CONFIG_SERIAL_MANY_PORTS
  61. #define EXTRA_SERIAL_PORT_DEFNS            \
  62.     { 0, BASE_BAUD, 0x1A0, 9, FOURPORT_FLAGS },     /* ttyS4 */    \
  63.     { 0, BASE_BAUD, 0x1A8, 9, FOURPORT_FLAGS },    /* ttyS5 */    \
  64.     { 0, BASE_BAUD, 0x1B0, 9, FOURPORT_FLAGS },    /* ttyS6 */    \
  65.     { 0, BASE_BAUD, 0x1B8, 9, FOURPORT_FLAGS },    /* ttyS7 */    \
  66.     { 0, BASE_BAUD, 0x2A0, 5, FOURPORT_FLAGS },    /* ttyS8 */    \
  67.     { 0, BASE_BAUD, 0x2A8, 5, FOURPORT_FLAGS },    /* ttyS9 */    \
  68.     { 0, BASE_BAUD, 0x2B0, 5, FOURPORT_FLAGS },    /* ttyS10 */    \
  69.     { 0, BASE_BAUD, 0x2B8, 5, FOURPORT_FLAGS },    /* ttyS11 */    \
  70.     { 0, BASE_BAUD, 0x330, 4, ACCENT_FLAGS },    /* ttyS12 */    \
  71.     { 0, BASE_BAUD, 0x338, 4, ACCENT_FLAGS },    /* ttyS13 */    \
  72.     { 0, BASE_BAUD, 0x000, 0, 0 },    /* ttyS14 (spare) */        \
  73.     { 0, BASE_BAUD, 0x000, 0, 0 },    /* ttyS15 (spare) */        \
  74.     { 0, BASE_BAUD, 0x100, 12, BOCA_FLAGS },    /* ttyS16 */    \
  75.     { 0, BASE_BAUD, 0x108, 12, BOCA_FLAGS },    /* ttyS17 */    \
  76.     { 0, BASE_BAUD, 0x110, 12, BOCA_FLAGS },    /* ttyS18 */    \
  77.     { 0, BASE_BAUD, 0x118, 12, BOCA_FLAGS },    /* ttyS19 */    \
  78.     { 0, BASE_BAUD, 0x120, 12, BOCA_FLAGS },    /* ttyS20 */    \
  79.     { 0, BASE_BAUD, 0x128, 12, BOCA_FLAGS },    /* ttyS21 */    \
  80.     { 0, BASE_BAUD, 0x130, 12, BOCA_FLAGS },    /* ttyS22 */    \
  81.     { 0, BASE_BAUD, 0x138, 12, BOCA_FLAGS },    /* ttyS23 */    \
  82.     { 0, BASE_BAUD, 0x140, 12, BOCA_FLAGS },    /* ttyS24 */    \
  83.     { 0, BASE_BAUD, 0x148, 12, BOCA_FLAGS },    /* ttyS25 */    \
  84.     { 0, BASE_BAUD, 0x150, 12, BOCA_FLAGS },    /* ttyS26 */    \
  85.     { 0, BASE_BAUD, 0x158, 12, BOCA_FLAGS },    /* ttyS27 */    \
  86.     { 0, BASE_BAUD, 0x160, 12, BOCA_FLAGS },    /* ttyS28 */    \
  87.     { 0, BASE_BAUD, 0x168, 12, BOCA_FLAGS },    /* ttyS29 */    \
  88.     { 0, BASE_BAUD, 0x170, 12, BOCA_FLAGS },    /* ttyS30 */    \
  89.     { 0, BASE_BAUD, 0x178, 12, BOCA_FLAGS },    /* ttyS31 */
  90. #else
  91. #define EXTRA_SERIAL_PORT_DEFNS
  92. #endif
  93.  
  94. /* You can have up to four HUB6's in the system, but I've only
  95.  * included two cards here for a total of twelve ports.
  96.  */
  97. #if (defined(CONFIG_HUB6) && defined(CONFIG_SERIAL_MANY_PORTS))
  98. #define HUB6_SERIAL_PORT_DFNS        \
  99.     { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,0) },  /* ttyS32 */    \
  100.     { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,1) },  /* ttyS33 */    \
  101.     { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,2) },  /* ttyS34 */    \
  102.     { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,3) },  /* ttyS35 */    \
  103.     { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,4) },  /* ttyS36 */    \
  104.     { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,5) },  /* ttyS37 */    \
  105.     { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,0) },  /* ttyS38 */    \
  106.     { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,1) },  /* ttyS39 */    \
  107.     { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,2) },  /* ttyS40 */    \
  108.     { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,3) },  /* ttyS41 */    \
  109.     { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,4) },  /* ttyS42 */    \
  110.     { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,5) },  /* ttyS43 */
  111. #else
  112. #define HUB6_SERIAL_PORT_DFNS
  113. #endif
  114.  
  115. #define MCA_SERIAL_PORT_DFNS
  116.  
  117. #define SERIAL_PORT_DFNS        \
  118.     STD_SERIAL_PORT_DEFNS        \
  119.     EXTRA_SERIAL_PORT_DEFNS        \
  120.     HUB6_SERIAL_PORT_DFNS        \
  121.     MCA_SERIAL_PORT_DFNS
  122.  
  123. #endif /* CONFIG_APUS */
  124.